﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="js/v5.1.3-dist/ol.css" rel="stylesheet" type="text/css" />
    <script src="js/v5.1.3-dist/ol.js" type="text/javascript"></script>
    <link href="css/example.css" rel="stylesheet" />
    <script src="js/InitMap.js"></script>
    <script type="text/javascript">
        window.onload = function () {
            var map = initMap();
        }

        /*====================设置地图背景=====================*/
        function setBgImg() {
            //获取地图容器元素
            var div = document.getElementById('map');
            //通过style的填充背景图属性设置背景
            div.style.backgroundImage = 'url(resources/map-background.jpg)';
        }
    </script>
</head>
<body>
    <input type="button" class="ButtonLib" id="setBackground" value="设置地图背景" onclick="setBgImg()" />
    <div id="map">
    </div>
</body>
</html>
